package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.exception.PhoneExistException;
import com.atguigu.gulimall.member.exception.UsernameExistException;
import com.atguigu.gulimall.member.vo.MemberLoginVo;
import com.atguigu.gulimall.member.vo.MemberRegisterVo;
import com.atguigu.gulimall.member.vo.SocialUserVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author zr
 * @email zr@gmail.com
 * @date 2022-08-27 10:51:06
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册会员
     *
     * @param registerVo 注册返回对象
     */
    void register(MemberRegisterVo registerVo);

    /**
     * 校验用户名是否存在
     *
     * @param username
     * @throws UsernameExistException
     */
    void checkUsername(String username) throws UsernameExistException;

    /**
     * 校验手机号是否存在
     *
     * @param phone
     * @throws PhoneExistException
     */
    void checkPhone(String phone) throws PhoneExistException;

    /**
     * 用户登录 返回用户消息
     * @param memberLoginVo
     * @return
     */
    MemberEntity login(MemberLoginVo memberLoginVo);

    /**
     * 社交登录
     * @param socialUserVo
     * @return
     */
    MemberEntity oAuthLogin(SocialUserVo socialUserVo);
}

